#include "Triangle_strip.h"


static const int VERTECT_MAX = 5;
static MyPoint arr[VERTECT_MAX] =
{
	//show a  square just only has four vertex
	/*
	{ 100, 200 },
	{ 200, 200 },
	{ 100, 100 },
	{ 200, 100 },
	{ 400, 100 }
	*/
	
	//show a polygon with five vetex
	
		{ 100, 200 },
		{ 100, 100 },
		{ 200, 200 },
		{ 200, 100 },
		{ 400, 100 }
	


	/*
		{ 200, 200 },
		{ 100, 200 },
		{ 100, 100 },
		{ 200, 100 },
		{ 400, 100 }
	*/
};
void Triangle_strip::render()
{
	glClear(GL_COLOR_BUFFER_BIT);

	glBegin(GL_TRIANGLE_STRIP);
	for (int i = 0; i < VERTECT_MAX; i++)
	{
		glVertex2i(arr[i].x, arr[i].y);

	}
	glEnd();
	//glutSwapBuffers();
	glFlush();
}
